using System;
using System.Collections.Generic;
using System.Drawing;
using NobleTech.Products.CreatureKingdom.Utils;

namespace NobleTech.Products.CreatureKingdom
{
    /// <summary>
    /// An abstract base class from which you can implement a renderer
    /// that represents your Organism with an Image such as a Bitmap
    /// </summary>
    public abstract class ImageRenderer : IRenderer
    {
        protected abstract Image Image { get; }
        protected abstract Color ColourToReplace { get; }

        public ImageRenderer(OrganismStats stats)
        {
        }

        public void Render(OrganismInfo info, PointD location, double directionFacing, Graphics g)
        {
            // TODO: Rotate image to reflect the direction we are facing
            float diameter = (float)info.Size * 2;
            g.DrawImage(Image, new RectangleF(0, 0, diameter, diameter));
            // TODO: Can't be bothered to search and replace pixels right now, just put a circle over it
            g.FillEllipse(new SolidBrush(info.Colour),
                new RectangleF(diameter * 2 / 3, 0, diameter / 3, diameter / 3));
        }
    }
}
